﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Crow.Library.Foundation.Bootstrapper;

namespace Crow.Library.Bootstrappers
{
    internal class ReferencedAssemblyLoader : IAssemblyLoader
    {
        public IEnumerable<Assembly> LoadAssemblies()
        {
            var referencedAssemblies = Assembly.GetExecutingAssembly().GetReferencedAssemblies();
            return referencedAssemblies.Select(asm => AppDomain.CurrentDomain.GetAssemblies().First(a => a.FullName == asm.FullName));
        }

        public void Dispose()
        {
            
        }
    }
}